package com.acme.bankapp.service.bank;

import com.acme.bankapp.domain.bank.*;

public class BankService {

	void addClient(Bank bank, Client client) {
		Client[] clients = bank.getClients();
		for (int i = 0; i < clients.length; i++) {
			if (clients[i] == null) {
				clients[i] = client;
				return;
			}
		}
		System.out.println("Error: account number limit is over");
	}

	void printMaximumAmountToWithdraw(Bank bank) {
		System.out.println("Maximum Amount To Withdraw :");
		for (Client client : bank.getClients()) {
			if (client != null) {
				System.out.println(client.getClientSalutation()
						+ client.getMaximumAmountToWithdraw());
			} else {
				break;
			}
		}
	}
}
